<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Service extends Model
{
    protected $table = 'service';
    protected $guarded = ['id'];
    protected $appends = ['house_name'];

    public function getHouseNameAttribute()
    {
        $coll = House::where(['id' => $this->attributes['house_id']])->first();
        if ($coll) {
            return $coll['title'];
        } else {
            return "--";
        }
    }


}
